
const request = ({url, data = {}, method = 'GET'}) => {
  return new Promise((resolve, reject) => {
    if (!url) {
      url = 'https://mp-live.mowa.com.cn/mp/live/list'
    }
    wx.request({
      url,
      method,
      data: data,
      success: function(res) {
        resolve(res)
      },
      fail: (err) => {
        reject(err)
      }
    });
  });
};

export function get({url = '', data = {}}) {
  return request({url, data, method: 'GET'})
}

export function post({url = '', data = {}}) {
  return request({url, data, method: 'POST'})
}